package com.lenovo.lcdm.dcm.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.lenovo.lcdm.common.enums.DeleteFlagEnum;
import com.lenovo.lcdm.dcm.dto.DcmConfigurationQueryDto;
import com.lenovo.lcdm.dcm.entity.DcmConfigurationMaster;
import com.lenovo.lcdm.dcm.mapper.DcmConfigurationMasterMapper;
import com.lenovo.lcdm.dcm.service.DcmConfigurationMasterService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author xujing30
* @description 针对表【dcm_configuration_master】的数据库操作Service实现
* @createDate 2024-01-19 10:25:26
*/
@Service
public class DcmConfigurationMasterServiceImpl extends ServiceImpl<DcmConfigurationMasterMapper, DcmConfigurationMaster>
    implements DcmConfigurationMasterService {

    @Override
    public DcmConfigurationMaster getByName(String name) {
        LambdaQueryWrapper<DcmConfigurationMaster> qw = new LambdaQueryWrapper<>();
        qw.eq(DcmConfigurationMaster::getName, name).eq(DcmConfigurationMaster::getDeleted, DeleteFlagEnum.NO.getValue());
        return this.getOne(qw);
    }

    @Override
    public List<DcmConfigurationMaster> getByLikeName(DcmConfigurationQueryDto queryDto) {
        return baseMapper.getMasterByNameAndInType(queryDto.getName(), queryDto.getBusinessOrSystem());
    }
}




